<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=1200,height=400,scrollbars=yes');
return false;
}
//-->
</SCRIPT>


<div id="tabs">

  <ul>
    <li><a href="#fragment-1"><span>Weight Distribution</span></a></li>
<%#*<li><a href="#fragment-2"><span>Height</span></a></li>%>
    <li><a href="#fragment-3"><span>BMI Distribution</span></a></li>
  </ul>

  <div id="fragment-1">

    <!-- The following section calculates the number of people for each 1 lb
    weight. This is the Y-axis value associated with each 1 lb weight.
    In this section the totals for each weight category is calculated for
    the tables at the bottom of the page!-->
    <%  
    underTotal = 0
    normalTotal = 0
    overweightTotal = 0
    obeseTotal = 0
    severeTotal = 0
    morbidTotal = 0
    totalTotal = 0

    underBMITotal = 0
    normalBMITotal = 0
    overweightBMITotal = 0
    obeseBMITotal = 0
    severeBMITotal = 0
    morbidBMITotal = 0
    totalBMITotal = 0

    count = 0
    grayBegin=4
    basisBegin=1
    genderString = params[:gender]
    raceString = params[:race]
    gender = genderString[0]
    race = raceString[0]

    if(params[:height_inch] != nil) #we are in US 
      height = Integer(params[:height_feet])
      height = height * 12
      height = height + Integer(params[:height_inch])
      underweight = ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0)    
      normal = ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0)
      overweight = ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0)
      obese = ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0)    
      severe = ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0)    

    else
      height = (Integer(params[:height_cm]) * 0.393700787).round(0)
      underweight = ((18.5 * (params[:height_cm].to_f / 2.54) * (params[:height_cm].to_f / 2.54)) / 703).round(0)
      normal = ((25 * (params[:height_cm].to_f / 2.54) * (params[:height_cm].to_f / 2.54)) / 703).round(0)
      overweight = ((30 * (params[:height_cm].to_f / 2.54) * (params[:height_cm].to_f / 2.54)) / 703).round(0)
      obese = ((35 * (params[:height_cm].to_f / 2.54) * (params[:height_cm].to_f / 2.54)) / 703).round(0)
      severe = ((40 * (params[:height_cm].to_f / 2.54) * (params[:height_cm].to_f / 2.54)) / 703).round(0)

    end
    db = SQLite3::Database.new( "db/patrick.sqlite3" )
    gray = db.get_first_row("select * from FullDataWeights where Gender='" + (gender) + "' and Age=" + params[:age].to_s + " and Race='" + (race) + "' and Year='" + params[:year].to_s + "' ")
    db.execute( "select * from BasisGraphs where Height=" + height.to_s) do |row|



      point = (row.at(basisBegin+1)* gray.at(grayBegin+1)) + (row.at(basisBegin+2)*gray.at(grayBegin+2)) + (row.at(basisBegin+3)*gray.at(grayBegin+3)) + (row.at(basisBegin+4)*gray.at(grayBegin+4)) + (row.at(basisBegin+5)*gray.at(grayBegin+5)) + (row.at(basisBegin+6)*gray.at(grayBegin+6)) + (row.at(basisBegin+7)*gray.at(grayBegin+7)) + (row.at(basisBegin+8)*gray.at(grayBegin+8)) 
      if(count+75 <= underweight)
        underTotal = underTotal+Integer(point * gray.at(grayBegin))        
      elsif(count+75 <= normal)
        normalTotal = normalTotal+Integer(point * gray.at(grayBegin))        
      elsif(count+75 <= overweight)
        overweightTotal = overweightTotal+Integer(point * gray.at(grayBegin))
      elsif(count+75 <= obese)
        obeseTotal = obeseTotal+Integer(point * gray.at(grayBegin))
      elsif(count+75 <= severe)
        severeTotal = severeTotal+Integer(point * gray.at(grayBegin))
      else
        morbidTotal = morbidTotal+Integer(point * gray.at(grayBegin))
      end


      count = count + 1
    end
    totalTotal = underTotal + normalTotal + overweightTotal + obeseTotal + severeTotal + morbidTotal
    count = 0
    bmiBasisBegin=0
    db.execute( "select * from BMIbasis") do |row|
      point = (row.at(bmiBasisBegin+1)* gray.at(grayBegin+1)) + (row.at(bmiBasisBegin+2)*gray.at(grayBegin+2)) + (row.at(bmiBasisBegin+3)*gray.at(grayBegin+3)) + (row.at(bmiBasisBegin+4)*gray.at(grayBegin+4)) + (row.at(bmiBasisBegin+5)*gray.at(grayBegin+5)) + (row.at(bmiBasisBegin+6)*gray.at(grayBegin+6)) + (row.at(bmiBasisBegin+7)*gray.at(grayBegin+7)) + (row.at(bmiBasisBegin+8)*gray.at(grayBegin+8)) 
      if (((count*0.5)+9.5) <= 18.5)
        underBMITotal = underBMITotal + Integer(point * gray.at(grayBegin))
      elsif (((count*0.5)+9.5) <= 25.0)
        normalBMITotal = normalBMITotal + Integer(point * gray.at(grayBegin))     

      elsif (((count*0.5)+9.5) <= 30.0)
        overweightBMITotal = overweightBMITotal + Integer(point * gray.at(grayBegin))

      elsif (((count*0.5)+9.5) <= 35.0)
        obeseBMITotal = obeseBMITotal + Integer(point * gray.at(grayBegin))

      elsif (((count*0.5)+9.5) <= 40.0)
        severeBMITotal = severeBMITotal + Integer(point * gray.at(grayBegin))

      else
        morbidBMITotal = morbidBMITotal + Integer(point * gray.at(grayBegin))
      end
      count = count + 1
    end
    totalBMITotal = underBMITotal + normalBMITotal + overweightBMITotal + obeseBMITotal + severeBMITotal + morbidBMITotal

    lessThanMe = []
    moreThanMe = []
    curTotal = 0
    lessThanMe << 0
    db.execute( "select * from BasisGraphs where Height=" + height.to_s) do |row|
      point = (row.at(basisBegin+1)* gray.at(grayBegin+1)) + (row.at(basisBegin+2)*gray.at(grayBegin+2)) + (row.at(basisBegin+3)*gray.at(grayBegin+3)) + (row.at(basisBegin+4)*gray.at(grayBegin+4)) + (row.at(basisBegin+5)*gray.at(grayBegin+5)) + (row.at(basisBegin+6)*gray.at(grayBegin+6)) + (row.at(basisBegin+7)*gray.at(grayBegin+7)) + (row.at(basisBegin+8)*gray.at(grayBegin+8)) 
      curTotal = curTotal + Integer(point * gray.at(grayBegin))
      lessThanMe << curTotal
    end

    db.execute( "select * from BasisGraphs where Height=" + height.to_s) do |row|
      point = (row.at(basisBegin+1)* gray.at(grayBegin+1)) + (row.at(basisBegin+2)*gray.at(grayBegin+2)) + (row.at(basisBegin+3)*gray.at(grayBegin+3)) + (row.at(basisBegin+4)*gray.at(grayBegin+4)) + (row.at(basisBegin+5)*gray.at(grayBegin+5)) + (row.at(basisBegin+6)*gray.at(grayBegin+6)) + (row.at(basisBegin+7)*gray.at(grayBegin+7)) + (row.at(basisBegin+8)*gray.at(grayBegin+8)) 
      curTotal = curTotal - Integer(point * gray.at(grayBegin))		
      moreThanMe << curTotal
    end

    lessThanMeBMI = []
    moreThanMeBMI = []
    curBMITotal = 0
    lessThanMe << 0
    db.execute( "select * from BMIbasis") do |row|
      point = (row.at(bmiBasisBegin+1)* gray.at(grayBegin+1)) + (row.at(bmiBasisBegin+2)*gray.at(grayBegin+2)) + (row.at(bmiBasisBegin+3)*gray.at(grayBegin+3)) + (row.at(bmiBasisBegin+4)*gray.at(grayBegin+4)) + (row.at(bmiBasisBegin+5)*gray.at(grayBegin+5)) + (row.at(bmiBasisBegin+6)*gray.at(grayBegin+6)) + (row.at(bmiBasisBegin+7)*gray.at(grayBegin+7)) + (row.at(bmiBasisBegin+8)*gray.at(grayBegin+8)) 
      curBMITotal = curBMITotal + Integer(point * gray.at(grayBegin))
      lessThanMeBMI << curBMITotal
    end
    db.execute( "select * from BMIbasis") do |row|
      point = (row.at(bmiBasisBegin+1)* gray.at(grayBegin+1)) + (row.at(bmiBasisBegin+2)*gray.at(grayBegin+2)) + (row.at(bmiBasisBegin+3)*gray.at(grayBegin+3)) + (row.at(bmiBasisBegin+4)*gray.at(grayBegin+4)) + (row.at(bmiBasisBegin+5)*gray.at(grayBegin+5)) + (row.at(bmiBasisBegin+6)*gray.at(grayBegin+6)) + (row.at(bmiBasisBegin+7)*gray.at(grayBegin+7)) + (row.at(bmiBasisBegin+8)*gray.at(grayBegin+8)) 
      curBMITotal = curBMITotal - Integer(point * gray.at(grayBegin))
      moreThanMeBMI << curBMITotal
    end


  %>

    <!-- This script contains and converts the values for the hover ToolTip for the individual's line !-->      
    <script>
      moreThanMe = <%= "#{moreThanMe.to_json}" %>;
      lessThanMe = <%= "#{lessThanMe.to_json}" %>;
      lessThanMeBMI = <%= "#{lessThanMeBMI.to_json}" %>;
      moreThanMeBMI = <%= "#{moreThanMeBMI.to_json}" %>;
      totalTotal = <%= "#{totalTotal.to_json}" %>;
      totalBMITotal = <%= "#{totalBMITotal.to_json}" %>;

    </script>
    <!-- First Results Table: Start !-->
    <table style="width: 100%">
      <tr>
        <td class="Columns" style="width: 60px"><strong>Gender</strong></td>        
        <td class="Columns" style="width: 60px"><strong>Race</strong></td>        
        <td class="Columns" style="width: 60px"><strong>Age</strong></td>                                        
        <td class="Columns" style="width: 90px"><strong>Weight</strong></td>
        <td class="Columns" style="width: 90px"><strong>Height</strong></td>
        <td class="Columns" style="width: 90px"><strong>Activity Level</strong></td>                
        <td class="Columns" style="width: 60px"><strong>Year</strong></td>        
        <td style="width: 30px">&nbsp;</td>

        <td class="Columns" style=" width: 90px">
          <strong>Peer Group</strong>
          <a rel='tipsy' href='#' title='The total number of people with
             the same gender, age, race, and height as you.'> <!-- Tooltip text for Peer Group !-->
            <%= image_tag "help.png", :size => "15x15" %></a>
        </td>

        <td class="Columns" style="width: 90px">
          <strong>BMI</strong>
          <a rel='tipsy' href='#' title='Body Mass Index (BMI) is a number
             calculated from a person&#39;s weight and height that provides an 
             indicator of body fatness.'>  <!-- Tooltip text for BMI !-->
            <%= image_tag "help.png", :size => "15x15" %></a>

        </td>
        <td class="Columns" style="width: 90px">
          <strong>% Body Fat</strong>
          <a id='east' href='#'  href='#' title='The percentage of a 
             person&#39;s total weight consisting of fat.'> <!-- Tooltip for for Body fat !-->
            <%= image_tag "help.png", :size => "15x15" %></a>
        </td>

        <td class="Columns" style=" width: 90px">
          <strong>Calories/day</strong>
          <a rel='tipsy' href='#' title='Estimated amount of daily calories you currently consume.'> <!-- Tooltip for Calories per day !-->
            <%= image_tag "help.png", :size => "15x15" %></a>
        </td>
      </tr>
      <tr>
        <!-- This inputs the values for the personal statistics table at the top of the page !-->
        <td class="Main_Tables_Results"><%= params[:gender] %></td>
        <td class="Main_Tables_Results"><%= params[:race] %></td>            
        <td class="Main_Tables_Results"><%= params[:age] %></td>
        <td class="Main_Tables_Results">
          <% if params[:weight_kg].nil? %>
            <%= params[:weight_lb] %> lb
          <% end %>
        </td>        
        <!-- These two section handles the ability to input data in metric format !-->
        <td class="Main_Tables_Results">
          <% if params[:height_cm].nil? %>
            <%= params[:height_feet]%> ft <%= params[:height_inch]%> inches
          <% end %>
        </td>      
        <td class="Main_Tables_Results"><%= params[:activity_level] %></td>                
        <td class="Main_Tables_Results"><%= params[:year] %></td>            
        <td></td>

        <!-- This inputs the population size of the peer group !-->
        <td class="Main_Tables_Results"><%= number_with_delimiter(totalTotal, :delimiter => ',')%> </td>

        <!-- This inputs the individual's BMI !-->
        <td class="Main_Tables_Results">
          <% if params[:weight_kg].nil? %>
            <%= ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(2) %>
          <% end %>
        </td>

        <!-- This section inputs the individual's percent body fat for the top bar table !-->
        <td class="Main_Tables_Results">
          <% if params[:weight_kg].nil? %>
            <% if params[:gender] == 'Male' %>
              <%= ((params[:weight_lb].to_f * 0.45359237 /100) * ((0.14*params[:age].to_f) + (37.31 * 2.302585093 * Math.log10((params[:weight_lb].to_f * 0.45359237) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f)*0.0254) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f)*0.0254))) - 103.94)).round(1) %> %
            <% end %>

            <% if params[:gender] == 'Female' %>
              <%= ((params[:weight_lb].to_f * 0.45359237 /100) * ((0.14*params[:age].to_f) + (39.96 * 2.302585093 * Math.log10((params[:weight_lb].to_f * 0.45359237) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f)*0.0254) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f)*0.0254))) - 102.01)).round(1) %> %
            <% end %>
          <% end %>               
        </td>         

        <!-- The following section is used to calculate the individual's calories per day.!-->
        <td class="Main_Tables_Results">     
          <% if params[:weight_kg].nil? %>
            <% if params[:gender] == "Male" %>

              <% if params[:activity_level] == "Sedentary" %>
                <%= number_with_delimiter(((((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2).round(0)), :delimiter => ',' ) %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <%= number_with_delimiter((((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375).round(0), :delimiter => ',' ) %>
              <% end %>   

              <% if params[:activity_level] == "Moderately Active" %>
                <%= number_with_delimiter((((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.550).round(0), :delimiter => ',' ) %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <%= number_with_delimiter((((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725).round(0), :delimiter => ',' ) %>
              <% end %>              

              <% if params[:activity_level] == "Extra Active" %>
                <%= number_with_delimiter((((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9).round(0), :delimiter => ',' ) %>
              <% end %>
            <% end %>

            <% if params[:gender] == "Female" %>

              <% if params[:activity_level] == "Sedentary" %>
                <%= number_with_delimiter((((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2).round(0), :delimiter => ',' ) %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <%= number_with_delimiter((((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375).round(0), :delimiter => ',' ) %>
              <% end %>

              <% if params[:activity_level] == "Moderately Active" %>
                <%= number_with_delimiter((((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55).round(0), :delimiter => ',' ) %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <%= number_with_delimiter((((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725).round(0), :delimiter => ',' ) %>
              <% end %>

              <% if params[:activity_level] == "Extra Active" %>
                <%= number_with_delimiter((((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9).round(0), :delimiter => ',' ) %>
              <% end %>               
            <% end %>
          <% end %>                        
        </td>			
      </tr>
    </table>
    <!-- First Results Table: END !-->





    <table style="width: 100%">
      <tr>
        <td id="chart" style="width: 700px" class="Graph-Section">
      <head>                    



      <body style="font-family: Arial;border: 0 none;">
        <!-- This section is where the chart distribution is inserted into this view. !-->
        <div>
          <%= high_chart("my_id", @h) do |c| %>                
            <%= "options.tooltip.formatter = function() { return ' There are ' + this.y +' people in this peer group that are ' +this.x+ ' lbs; '+Math.round(moreThanMe[this.x-75]/totalTotal*100)+ '% of this peer group are heavier' +', ' +Math.round(lessThanMe[this.x-75]/totalTotal*100)+ '% of this peer group are lighter.';}" %>	


          <%end %>		                     
        </div>
      </body>


      </td>
      </tr>
    </table>

    <!-- Results Table !--> 
    <table style="width: 100%">

      <tr>
        <!-- Each of the if / else statements is to highlight that column's
        header label when the individual falls under that specific category of
        weight. The color corresponds to the color of the category on the graph!-->

        <td style="width: 300px">&nbsp;</td>
        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 18.5 %>
          <td colspan="2" class="Columns" style="width: 100px; color: #000000 ; background: #d4d624; font-weight: bold;"><strong>Underweight</strong>
            <a rel='tipsy' href='#' title='BMI less than 18.5'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% else %>  
          <td colspan="2" class="Columns" style="width: 100px"><strong>Underweight</strong>
            <a rel='tipsy' href='#' title='BMI less than 18.5'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% end %>

        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 25 && 
            ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 18.5 %>                  
          <td colspan="2" class="Columns" style="width: 100px; color: #000000 ; background: #9dd624" ><strong>Normal</strong>
            <a rel='tipsy' href='#' title='BMI between 18.5 and 25.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% else %>
          <td colspan="2" class="Columns" style="width: 100px" ><strong>Normal</strong>
            <a rel='tipsy' href='#' title='BMI between 18.5 and 25.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>                
        <% end %>

        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 30 && 
            ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 25 %>                  
          <td colspan="2" class="Columns" style="width: 100px; color: #FFFFFF ; background: #d66f24"><strong>Overweight</strong>
            <a rel='tipsy' href='#' title='BMI between 25.0 and 30.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% else %>
          <td colspan="2" class="Columns" style="width: 100px"><strong>Overweight</strong>
            <a rel='tipsy' href='#' title='BMI between 25.0 and 30.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>                
        <% end %>

        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 35 && 
            ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 30 %>                    
          <td colspan="2" class="Columns" style="width: 100px; color: #FFFFFF ; background: #d64624"><strong>Obese</strong>
            <a rel='tipsy' href='#' title='BMI between 30.0 and 35.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% else %>
          <td colspan="2" class="Columns" style="width: 100px"><strong>Obese</strong>
            <a rel='tipsy' href='#' title='BMI between 30.0 and 35.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>                
        <% end %>

        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 40 && 
            ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 35 %>                  
          <td colspan="2" class="Columns" style="width: 100px; color: #FFFFFF ; background: #d62424"><strong>Severely Obese</strong>
            <a rel='tipsy' href='#' title='BMI between 35.0 and 40.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>  
        <% else %>
          <td colspan="2" class="Columns" style="width: 100px"><strong>Severely Obese</strong>
            <a rel='tipsy' href='#' title='BMI between 35.0 and 40.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>                  
        <% end %>

        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 40 %>                
          <td colspan="2" class="Columns" style="width: 100px; color: #FFFFFF ; background: #000000"><strong>Morbidly Obese</strong>
            <a rel='tipsy' href='#' title='BMI over 40'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% else %>
          <td colspan="2" class="Columns" style="width: 100px"><strong>Morbidly Obese</strong>
            <a rel='tipsy' href='#' title='BMI over 40.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>                
        <% end %>
      </tr>
      <tr>
        <!-- This section creates the row in the chart which displays the weight
        categories for this specific person's peer group!-->
        <td class="Additional_Results_Columns" style="width: 300px">Ranges of weight categories (pounds)</td>
        <td class="Additional_Results_UnderWeight">Less</td>
        <td class="Additional_Results_UnderWeight">
          <% if params[:weight_kg].nil? %>
            <%= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
          <% end %>
        </td>
        <td class="Additional_Results_Normal">
          <% if params[:weight_kg].nil? %>
            <%= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
          <% end %>
        </td>
        <td class="Additional_Results_Normal">
          <% if params[:weight_kg].nil? %>
            <%= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
          <% end %>      
        </td>
        <td class="Additional_Results_OverWeight">
          <% if params[:weight_kg].nil? %>
            <%= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
          <% end %>         
        </td>
        <td class="Additional_Results_OverWeight">
          <% if params[:weight_kg].nil? %>
            <%= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
          <% end %>            
        </td>
        <td class="Additional_Results_Obese">
          <% if params[:weight_kg].nil? %>
            <%= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
          <% end %>              
        </td>
        <td class="Additional_Results_Obese">
          <% if params[:weight_kg].nil? %>
            <%= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
          <% end %>              
        </td>
        <td class="Additional_Results_SeverelyObese">
          <% if params[:weight_kg].nil? %>
            <%= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
          <% end %>          
        </td>
        <td class="Additional_Results_SeverelyObese">
          <% if params[:weight_kg].nil? %>
            <%= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
          <% end %>               
        </td>
        <td class="Additional_Results_MorbidlyObeseObese">
          <% if params[:weight_kg].nil? %>
            <%= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
          <% end %>               
        </td>
        <td class="Additional_Results_MorbidlyObeseObese">Greater</td>
      </tr>
      <tr>
        <!-- This section displays the row in the chart wtih population totals
        for each weight category.  Each number is delimited by commas for proper
        number format. !-->
        <td class="Additional_Results_Columns" style="width: 300px">Number of people in each weight category (%)</td>
        <td colspan="2" class="Additional_Results_UnderWeight"><%= number_with_delimiter(underTotal, :delimiter => ',') + " (" + (100*((underTotal+1.0) / totalTotal)).round(1).to_s + " %)"%></td>
        <td colspan="2" class="Additional_Results_Normal"><%= number_with_delimiter(normalTotal, :delimiter => ',') + " (" + (100 * ((normalTotal+1.0) / totalTotal)).round(1).to_s + " %)"%></td>
        <td colspan="2" class="Additional_Results_OverWeight"><%= number_with_delimiter(overweightTotal, :delimiter => ',') + " (" + (100 * ((overweightTotal+1.0) / totalTotal)).round(1).to_s + " %)"%></td>
        <td colspan="2" class="Additional_Results_Obese"><%= number_with_delimiter(obeseTotal, :delimiter => ',') + " (" + (100 * ((obeseTotal+1.0) / totalTotal)).round(1).to_s + " %)"%></td>
        <td colspan="2" class="Additional_Results_SeverelyObese"><%= number_with_delimiter(severeTotal, :delimiter => ',') + " (" + (100 * ((severeTotal+1.0) / totalTotal)).round(1).to_s + " %)"%></td>
        <td colspan="2" class="Additional_Results_MorbidlyObeseObese"><%= number_with_delimiter(morbidTotal, :delimiter => ',') + " (" + (100 * ((morbidTotal+1.0) / totalTotal)).round(1).to_s + " %)"%></td>
      </tr>
      <tr>
        <!-- This section creates the row in the chart which calculates the
        number of pounds an individual with the current weight statistics would
        need to gain or lose to make it to the category listed.  This is calculated based on
        Activity Level and estimated caloric intake functions.!-->
        <td class="Additional_Results_Columns" style="width: 300px">Pounds (+/-) needed to reach weight categories</td>
        <td colspan="2" class="Additional_Results_UnderWeight">
          <% if params[:weight_kg].nil? %>
            <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <%= (((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
            <% end %>
            <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                <%= 0 %>
              <% end %>
              <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                <%= (((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
              <% end %>                  
            <% end %>
          <% end %>                                    
        </td>
        <td colspan="2" class="Additional_Results_Normal">

          <% if params[:weight_kg].nil? %>
            <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <%= (((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
            <% end %>
            <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                <%= 0 %>
              <% end %>
              <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                <%= (((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
              <% end %>                  
            <% end %>
          <% end %>                         
        </td>
        <td colspan="2" class="Additional_Results_OverWeight">

          <% if params[:weight_kg].nil? %>
            <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <%= (((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
            <% end %>
            <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                <%= 0 %>
              <% end %>
              <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                <%= (((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
              <% end %>                  
            <% end %>
          <% end %>                 
        </td>
        <td colspan="2" class="Additional_Results_Obese">

          <% if params[:weight_kg].nil? %>
            <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <%= (((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
            <% end %>
            <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                <%= 0 %>
              <% end %>
              <% if params[:weight_lb].to_f < ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                <%= (((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
              <% end %>                  
            <% end %>
          <% end %>
        </td>
        <td colspan="2" class="Additional_Results_SeverelyObese">

          <% if params[:weight_kg].nil? %>
            <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <%= (((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
            <% end %>
            <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                <%= 0 %>
              <% end %>
              <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                <%= (((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
              <% end %>                  
            <% end %>
          <% end %>                  
        </td>
        <td colspan="2" class="Additional_Results_MorbidlyObeseObese">

          <% if params[:weight_kg].nil? %>
            <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <%= 0 %>
            <% end %>
            <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
              <%= (((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703) - params[:weight_lb].to_f).round(0) %>
            <% end %>                  
          <% end %>                  
        </td>
      </tr>
      <tr>
        <!-- Based on the current individual's statistics and the number of
        pounds they would need to move into each category. This row of the chart
        is calculated to display the daily calories added or subtracted from the
        individual's current intake to reach this new category. This is also based
        on the activity level which was submitted on the front page.!-->
        <td class="Additional_Results_Columns" style="width: 300px">Daily calories needed to reach weight categories in a year (%)</td>
        <td colspan="2" class="Additional_Results_UnderWeight">
          <% if params[:weight_kg].nil? %>
            <% if params[:gender] == "Male" %>
             
              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                  <%= '%)' %>
                <% end %>
                <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                    <%= '%)' %>                            
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                  
                <% end %>
                <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                    <%= '%)' %>                            
                  <% end %>                  
                <% end %>
              <% end %>    

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                    <%= '%)' %>                      
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                      
                <% end %>
                <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                    <%= '%)' %> 
                  <% end %>                  
                <% end %>
              <% end %>                  

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                    <%= '%)' %>                               
                  <% end %>                  
                <% end %>
              <% end %>
            <% end %>

            <% if params[:gender] == "Female" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                     
                <% end %>
                <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                    <%= '%)' %>                     
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                     
                <% end %>
                <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                    <%= '%)' %>                  
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                  
                <% end %>
                <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                    <%= '%)' %>                         
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                         
                <% end %>
                <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                    <%= '%)' %>                       
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f > ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                       
                <% end %>
                <% if params[:weight_lb].to_f <= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((16.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>                  

            <% end %>
          <% end %>

        </td>
        <td colspan="2" class="Additional_Results_Normal">
          <% if params[:weight_kg].nil? %>
            <% if params[:gender] == "Male" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                    <%= '%)' %>                      
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                      
                <% end %>
                <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                    <%= '%)' %>                              
                  <% end %>                  
                <% end %>
              <% end %>    

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                              
                <% end %>
                <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %>                            <%= '('%> 
                    <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                    <%= '%)' %>                       
                  <% end %>                  
                <% end %>
              <% end %>                  

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                       
                <% end %>
                <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                    <%= '%)' %>                       
                  <% end %>                  
                <% end %>
              <% end %>
            <% end %>

            <% if params[:gender] == "Female" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                    <%= '%)' %>                      
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                      
                <% end %>
                <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                    <%= '%)' %>                     
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                     
                <% end %>
                <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f > ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((18.5 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                    <%= '%)' %>                    
                  <% end %>                  
                <% end %>
              <% end %>                  

            <% end %>
          <% end %>
        </td>                  
        <td colspan="2" class="Additional_Results_OverWeight">
          <% if params[:weight_kg].nil? %>
            <% if params[:gender] == "Male" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                     
                <% end %>
                <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                    <%= '%)' %>                     
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                     
                <% end %>
                <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                    <%= '%)' %>                    
                  <% end %>                  
                <% end %>
              <% end %>    

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                    <%= '%)' %>                    
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>                  

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                    <%= '%)' %>                    
                  <% end %>                  
                <% end %>
              <% end %>
            <% end %>

            <% if params[:gender] == "Female" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                    <%= '%)' %>                    
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                    <%= '%)' %>                       
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                       
                <% end %>
                <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                    <%= '%)' %>                     
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f > ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                     
                <% end %>
                <% if params[:weight_lb].to_f <= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                    <%= '%)' %>                      
                  <% end %>                  
                <% end %>
              <% end %>                  

            <% end %>
          <% end %>
        </td>                  
        <td colspan="2" class="Additional_Results_Obese">
          <% if params[:weight_kg].nil? %>
            <% if params[:gender] == "Male" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                  
                <% end %>
                <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                    <%= '%)' %>                     
                  <% end %>                  
                <% end %>
              <% end %>    

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                     
                <% end %>
                <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                    <%= '%)' %>                      
                  <% end %>                  
                <% end %>
              <% end %>                  

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                      
                <% end %>
                <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>
            <% end %>

            <% if params[:gender] == "Female" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((30.0 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                    <%= '%)' %>                       
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                       
                <% end %>
                <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                    <%= ' ('%> 
                    <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f > ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((30 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                    <%= '%)' %>                     
                  <% end %>                  
                <% end %>
              <% end %>                  

            <% end %>
          <% end %>
        </td>                  
        <td colspan="2" class="Additional_Results_SeverelyObese">
          <% if params[:weight_kg].nil? %>
            <% if params[:gender] == "Male" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                    <%= '%)' %>                     
                  <% end %>                  
                <% end %>
              <% end %>    

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                     
                <% end %>
                <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                    <%= '%)' %>                     
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                     
                <% end %>
                <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                    <%= '%)' %>                    
                  <% end %>                  
                <% end %>
              <% end %>                  

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40* (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                    <%= '%)' %>                        
                  <% end %>                  
                <% end %>
              <% end %>
            <% end %>

            <% if params[:gender] == "Female" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                    <%= '%)' %>                   
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
                <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                    <%= '%)' %>                             
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                             
                <% end %>
                <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                    <%= '%)' %>                    
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                    <%= '%)' %>                    
                  <% end %>                  
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f > ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>
                <% if params[:weight_lb].to_f <= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <% if params[:weight_lb].to_f >= ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= 0 %>
                  <% end %>
                  <% if params[:weight_lb].to_f < ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                    <%= number_with_delimiter(((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                    <%= '('%> 
                    <%=  ((((((9.99 * ((35 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                            (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                    <%= '%)' %>                              
                  <% end %>                  
                <% end %>
              <% end %>                  

            <% end %>
          <% end %>
        </td>                  
        <td colspan="2" class="Additional_Results_MorbidlyObeseObese">
          <% if params[:weight_kg].nil? %>
            <% if params[:gender] == "Male" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= 0 %>
                <% end %>
                <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)).round(0), :delimiter => ',' ) %>    
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                      
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= 0 %>
                <% end %>
                <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)).round(0), :delimiter => ',' ) %> 
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.375)) *100).round(1) %>
                  <%= '%)' %>          
                <% end %>
              <% end %>  

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= 0 %>
                <% end %>
                <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)).round(0), :delimiter => ',' ) %> 
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= 0 %>
                <% end %>
                <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)).round(0), :delimiter => ',' ) %> 
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
              <% end %>               

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= 0 %>
                <% end %>
                <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) + 5) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                   
                <% end %>
              <% end %>

            <% end %>

            <% if params[:gender] == "Female" %>

              <% if params[:activity_level] == "Sedentary" %>
                <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= 0 %>
                <% end %>
                <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.2)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>                  
              <% end %>

              <% if params[:activity_level] == "Lightly Active" %>
                <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= 0 %>
                <% end %>
                <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.375)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>                  
              <% end %>

              <% if params[:activity_level] == "Moderately Active" %>
                <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= 0 %>
                <% end %>
                <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.55)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>                  
              <% end %>

              <% if params[:activity_level] == "Very Active" %>
                <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= 0 %>
                <% end %>
                <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.725)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>                  
              <% end %>

              <% if params[:activity_level] == "Extra Active" %>
                <% if params[:weight_lb].to_f >= ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= 0 %>
                <% end %>
                <% if params[:weight_lb].to_f < ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703).round(0) %>
                  <%= number_with_delimiter(((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                      (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)).round(0), :delimiter => ',' ) %>
                  <%= '('%> 
                  <%=  ((((((9.99 * ((40 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f)) / 703)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9) -
                          (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) / 
                        (((9.99 * (params[:weight_lb].to_f)*0.45359237) + (6.25 * (params[:height_feet].to_f*12 +params[:height_inch].to_f) * 2.54) - (4.92 * params[:age].to_f) - 161) * 1.9)) *100).round(1) %>
                  <%= '%)' %>                    
                <% end %>                  
              <% end %>            
            <% end %>

          <% end %>
        </td>                  

      </tr>

    </table>
    <br><strong class="Info-Pane-Titles">Do I have a healthy body weight?</strong><br>
                        <br />
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 18.5 %>             
                        <span class="Info-Pane-Contents">You are underweight. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 18.5 or less is considered to be underweight.</span>          
              <% end %>                          
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 25 && 
                  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 18.5 %>             
                        <span class="Info-Pane-Contents">You have a healthy body weight. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 18.5 to 25.0 is considered to be at a healthy weight. </span>
              <% end %>
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 30 && 
                  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 25 %>             
                        <span class="Info-Pane-Contents">You are overweight. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 25.0 to 30.0 is considered to be overweight.</span>          
              <% end %>
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 35 && 
                  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 30 %>             
                        <span class="Info-Pane-Contents">You are obese. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 30.0 to 35.0 is considered to be obese.</span>          
              <% end %>    
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 40 && 
                  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 35 %>             
                        <span class="Info-Pane-Contents">You are severely obese. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 35.0 to 40.0 is considered to be severely obese.</span>          
              <% end %> 
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 40 %>             
                        <span class="Info-Pane-Contents">You are morbidly obese. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 40 or above is considered to be morbidly obese. This can increase a person's risk of death from any cause by 50% to 150%.</span>          
              <% end %>  
    <!-- Results Table !--> 
  </div>
  <!-- Here starts the next section for the BMI tab !-->
  <div id="fragment-3">
    <!-- First Results Table: Start !-->
    <table style="width: 100%">
      <tr>                                     
        <td class="Columns" style="width: 60px"><strong>Gender</strong></td>
        <td class="Columns" style="width: 60px"><strong>Race</strong></td>
        <td class="Columns" style="width: 60px"><strong>Age</strong></td>           
        <td class="Columns" style="width: 60px"><strong>Year</strong></td>        
        <td style="width: 120px">&nbsp;</td>

        <td class="Columns" style=" width: 90px">
          <strong>Peer Group</strong>
          <a rel='tipsy' href='#' title='The total number of people with the same gender, age, and race as you.'> <!-- #Tooltip for peer group. -->
            <%= image_tag "help.png", :size => "15x15" %></a>
        </td>

        <td class="Columns" style="width: 90px">
          <strong>BMI</strong>
          <a rel='tipsy' href='#' title='Body Mass Index (BMI) is a number calculated from a person&#39;s weight and height that provides an indicator of body fatness.'>
            <%= image_tag "help.png", :size => "15x15" %></a>
        </td>
      </tr>
      <tr>
        <td class="Main_Tables_Results"><%= params[:gender] %></td>
        <td class="Main_Tables_Results"><%= params[:race] %></td>
        <td class="Main_Tables_Results"><%= params[:age] %></td> 
        <td class="Main_Tables_Results"><%= params[:year] %></td>           
        <td></td>

        <td class="Main_Tables_Results"><%= number_with_delimiter(totalBMITotal, :delimiter => ',')%> </td>	
        <td class="Main_Tables_Results">
          <% if params[:weight_kg].nil? %>
            <%= ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(2) %>
          <% end %>
        </td>
        </td>
      </tr>
    </table>
    <!-- First Results Table: END !-->
    <table style="width: 100%">
      <tr>
        <td id="chart" style="width: 700px" class="Graph-Section">
      <head>                       

      <body style="font-family: Arial;border: 0 none;">
        <div>
    <!-- BMI Chart insert and tooltip display configuration -->

          <%= high_chart("my_id2", @h2) do |c| %>
            <%= "options.tooltip.formatter = function() { return 'There are ' + this.y +' people in this peer group that are ' +this.x+' lbs; '+Math.round(moreThanMeBMI[(this.x-10)*2]/totalBMITotal*100)+ '% of this peer group are heavier, ' +Math.round(lessThanMeBMI[(this.x-10)*2]/totalBMITotal*100)+ '% in this peer group are lighter.';}" %>	
          <%end %>  


        </div>
      </body>


      </td>
      </tr>
    </table>

    <!-- Results Table !--> 
    <table style="width: 100%">

      <tr>
        <td style="width: 300px">&nbsp;</td>
        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 18.5 %>
          <td colspan="2" class="Columns" style="width: 100px; color: #FFFFFF ; background: #d4d624"><strong>Underweight</strong>
            <a rel='tipsy' href='#' title='BMI less than 18.5'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% else %>  
          <td colspan="2" class="Columns" style="width: 100px"><strong>Underweight</strong>
            <a rel='tipsy' href='#' title='BMI less than 18.5'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% end %>

        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 25 && 
            ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 18.5 %>                  
          <td colspan="2" class="Columns" style="width: 100px; color: #FFFFFF ; background: #9dd624" ><strong>Normal</strong>
            <a rel='tipsy' href='#' title='BMI between 18.5 and 25.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% else %>
          <td colspan="2" class="Columns" style="width: 100px" ><strong>Normal</strong>
            <a rel='tipsy' href='#' title='BMI between 18.5 and 25.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>                
        <% end %>

        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 30 && 
            ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 25 %>                  
          <td colspan="2" class="Columns" style="width: 100px; color: #FFFFFF ; background: #d66f24"><strong>Overweight</strong>
            <a rel='tipsy' href='#' title='BMI between 25.0 and 30.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% else %>
          <td colspan="2" class="Columns" style="width: 100px"><strong>Overweight</strong>
            <a rel='tipsy' href='#' title='BMI between 25.0 and 30.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>                
        <% end %>

        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 35 && 
            ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 30 %>                    
          <td colspan="2" class="Columns" style="width: 100px; color: #FFFFFF ; background: #d64624"><strong>Obese</strong>
            <a rel='tipsy' href='#' title='BMI between 30.0 and 35.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% else %>
          <td colspan="2" class="Columns" style="width: 100px"><strong>Obese</strong>
            <a rel='tipsy' href='#' title='BMI between 30.0 and 35.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>                
        <% end %>

        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 40 && 
            ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 35 %>                  
          <td colspan="2" class="Columns" style="width: 100px; color: #FFFFFF ; background: #d62424"><strong>Severely Obese</strong>
            <a rel='tipsy' href='#' title='BMI between 35.0 and 40.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>  
        <% else %>
          <td colspan="2" class="Columns" style="width: 100px"><strong>Severely Obese</strong>
            <a rel='tipsy' href='#' title='BMI between 35.0 and 40.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>                  
        <% end %>

        <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 40 %>                
          <td colspan="2" class="Columns" style="width: 100px; color: #FFFFFF ; background: #000000"><strong>Morbidly Obese</strong>
            <a rel='tipsy' href='#' title='BMI over 40.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>
        <% else %>
          <td colspan="2" class="Columns" style="width: 100px"><strong>Morbidly Obese</strong>
            <a rel='tipsy' href='#' title='BMI over 40.0'>
              <%= image_tag "help.png", :size => "15x15" %></a>
          </td>                
        <% end %>
      </tr>
      <tr>
        <td class="Additional_Results_Columns" style="width: 300px">Ranges of weight categories (pounds)</td>
        <td class="Additional_Results_UnderWeight">Less</td>
        <td class="Additional_Results_UnderWeight">18.5</td>
        <td class="Additional_Results_Normal">18.5</td>
        <td class="Additional_Results_Normal">25</td>
        <td class="Additional_Results_OverWeight">25</td>
        <td class="Additional_Results_OverWeight">30</td>
        <td class="Additional_Results_Obese">30</td>
        <td class="Additional_Results_Obese">35</td>
        <td class="Additional_Results_SeverelyObese">35</td>
        <td class="Additional_Results_SeverelyObese">40</td>
        <td class="Additional_Results_MorbidlyObeseObese">40</td>
        <td class="Additional_Results_MorbidlyObeseObese">Greater</td>
      </tr>
      <tr>
        <td class="Additional_Results_Columns" style="width: 300px">Number of people in each weight category (%)</td>
        <td colspan="2" class="Additional_Results_UnderWeight"><%= number_with_delimiter(underBMITotal, :delimiter => ',') + " (" + (100*((underBMITotal+1.0) / totalBMITotal)).round(1).to_s + " %)"%></td>
        <td colspan="2" class="Additional_Results_Normal"><%= number_with_delimiter(normalBMITotal, :delimiter => ',') + " (" + (100 * ((normalBMITotal+1.0) / totalBMITotal)).round(1).to_s + " %)"%></td>
        <td colspan="2" class="Additional_Results_OverWeight"><%= number_with_delimiter(overweightBMITotal, :delimiter => ',') + " (" + (100 * ((overweightBMITotal+1.0) / totalBMITotal)).round(1).to_s + " %)"%></td>
        <td colspan="2" class="Additional_Results_Obese"><%= number_with_delimiter(obeseBMITotal, :delimiter => ',') + " (" + (100 * ((obeseBMITotal+1.0) / totalBMITotal)).round(1).to_s + " %)"%></td>
        <td colspan="2" class="Additional_Results_Obese"><%= number_with_delimiter(severeBMITotal, :delimiter => ',') + " (" + (100 * ((severeBMITotal+1.0) / totalBMITotal)).round(1).to_s + " %)"%></td>
        <td colspan="2" class="Additional_Results_SeverelyObese"><%= number_with_delimiter(morbidBMITotal, :delimiter => ',') + " (" + (100 * ((morbidBMITotal+1.0) / totalBMITotal)).round(1).to_s + " %)"%></td>
      </tr>

    </table>

    <!-- This section creates the textual description of the individual's results with if/else statements based on their BMI. !-->
    
    <br><strong class="Info-Pane-Titles">Do I have a healthy body weight?</strong><br>
                        <br />
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 18.5 %>             
                        <span class="Info-Pane-Contents">You are underweight. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 18.5 or less is considered to be underweight.</span>          
              <% end %>                          
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 25 && 
                  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 18.5 %>             
                        <span class="Info-Pane-Contents">You have a healthy body weight. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 18.5 to 25.0 is considered to be at a healthy weight. </span>
              <% end %>
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 30 && 
                  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 25 %>             
                        <span class="Info-Pane-Contents">You are overweight. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 25.0 to 30.0 is considered to be overweight.</span>          
              <% end %>
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 35 && 
                  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 30 %>             
                        <span class="Info-Pane-Contents">You are obese. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 30.0 to 35.0 is considered to be obese.</span>          
              <% end %>    
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) < 40 && 
                  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 35 %>             
                        <span class="Info-Pane-Contents">You are severely obese. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 35.0 to 40.0 is considered to be severely obese.</span>          
              <% end %> 
              <% if ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))) > 40 %>             
                        <span class="Info-Pane-Contents">You are morbidly obese. You have a BMI of <%=  ((params[:weight_lb].to_f * 703) / ((params[:height_feet].to_f*12 +params[:height_inch].to_f) * (params[:height_feet].to_f*12 +params[:height_inch].to_f))).round(1) %>
                and a person with a BMI of 40 or above is considered to be morbidly obese. This can increase a person's risk of death from any cause by 50% to 150%.</span>          
              <% end %>  
  </div>
  

  <!-- This section is the slide out input tab for the individual's information
  It mirrors exactly the input screen on the front page. -->
  <div class="slide-out-div">
    <a class="handle" href="http://link-for-non-js-users.html">Content</a>
    <form>
      </br>
      </br>
      Enter Your Information:
      </br>

      <div>
              <div id="notice"><%= flash[:notice] %></div>
        <%= form_tag('home/') do %>
          <ul>
            <%= label_tag :gender %>
            <%= select_tag(:gender,
              options_for_select(Bmi::GENDER_LIST), :include_blank => false) %>
          </ul>
          <ul>
            <%= label_tag :race %>
            <%= select_tag(:race,
              options_for_select(Bmi::RACE_LIST), :include_blank => false) %>
          </ul>              
          <ul>
            <%= label_tag :age %>
            <%= number_field_tag(:age, nil, :in => 18...66) %> (18 - 65)
          </ul>           
          <ul>
            <%= label_tag :weight %>
            <%= number_field_tag(:weight_lb, nil, :in => 75...351)+ "lb"  %> (75 - 350)
          </ul>
          <ul>
            <%= label_tag :height %>
            <%= select_tag(:height_feet, options_for_select(Bmi::FEET_LIST, 5)) + "feet" + select_tag(:height_inch, options_for_select(Bmi::INCH_LIST)) +  "inch"%>
          </ul>
          <ul>
            <%= label_tag :activity_level %>
              <a HREF="/popup.html" onClick="return popup(this, 'notes')"><%= image_tag "popup_icon.gif", :size => "15x15" %></a>
            <%= select_tag(:activity_level,
            options_for_select(Bmi::ACTIVITY_LEVEL), :include_blank => false) %>
          </ul>                  
          <ul>                    
            <%= label_tag :year %>
            <a rel='tipsy' title='Select the year of U.S. statistics for your comparison.'>
              <%= image_tag "help.png", :size => "15x15" %></a>
            <%= select_tag(:year,
              options_for_select(Bmi::YEAR_LIST, "2010")) %>
          </ul>
          <ul>
            <%= submit_tag("Calculate") %>
          </ul>
        <% end %>
      </div>

    </form>
  </div>

</div>
<br>

</br>
